define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'jizhan.store/index',
        add_url: 'jizhan.store/add',
        edit_url: 'jizhan.store/edit',
        delete_url: 'jizhan.store/delete',
        export_url: 'jizhan.store/export',
        modify_url: 'jizhan.store/modify',
    };
    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    // 订单号|类型,用户昵称|ID|代理等级,商品名称,规格,购买数量,下单基站,下单时间,销售价,优惠金额,实际支付,返利积分,支付方式,订单 状态,完成时间
                    {type: "checkbox"},
                    {field: 'id', width: 30, title: 'ID', search: 'no'},
                    {field: 'name', width: 150, title: '门店名称'},
                    {field: 'address', minWidth: 250, title: '门店地址', search: 'no'},
                    {field: 'lng', minWidth: 100, title: '门店位置-经度', search: 'no'},
                    {field: 'lat', minWidth: 100, title: '门店位置-纬度', search: 'no'},
                    {field: 'province', minWidth: 100, title: '省', search: 'no'},
                    {field: 'city', minWidth: 100, title: '市', search: 'no'},
                    {field: 'district', minWidth: 100, title: '区', search: 'no'},
                    {field: 'is_main', minWidth: 50, title: '是否主店', selectList:{0:"否",1:"是"}},
                    {field: 'type', minWidth: 80, title: '类型', selectList:{1:"自营基站",2:"加盟基站"}},
                    {field: 'qrcode', minWidth: 150, title: '门店二维码', search: 'no', templet: ea.table.image},
                    {field: 'remark', minWidth: 120, title: '备注说明', search: 'no'},
                    {field: 'create_time', minWidth: 120, title: '创建时间', search: 'no'},
                    {width: 250, title: '操作', templet: ea.table.tool}
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});